<template>
	<view class="kuangjia">
		<view class="kapian p2" v-for="item in nianka" :key="item.id" @click="gonkqiang"> <!-- :class="item.kalx==0?'kapian p1':'kapian p2'" -->
			<view class="katou">
				<!-- <view class="kpmc">{{item.kalx==0?'至尊黑金卡':'荣耀铂金卡'}}</view> -->
				<view>No.{{item.kaid}}</view>
			</view>
			<view class="neirong">
				<view class="vipzs">VIP尊享</view>
				<view class="cishu">
					<view class="chis">{{item.chishu}}</view>
					<view class="danw">/次</view>
				</view>
			</view>
			<view class="youxq">有效期:{{item.youxq}}</view>
		</view>
		<view class="tianjia" @click="goNiankaAdd">
			<image class="tianjia" src="../../static/tianjia.png"></image>
			<view>办理年卡</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nianka:[]
			}
		},
		onLoad() {
			
		},
		onShow() {
			this.getNklist();
		},
		methods: {
			goNiankaAdd(){
				uni.navigateTo({
					url:'../niankaadd/niankaadd'
				})
			},
			getNklist() {
				uni.request({
					url: getApp().globalData.url + '/client/GetNklist',
					data: {
						id: uni.getStorageSync('user_key').id,
					},
					method: "GET",
					header: {
						"Content-Type": "application/json"
					},
					success: (res) => {
						// console.log(res);
						if(res.data.code == 200) {
							this.nianka = res.data.data;
						}

					}
				})
			},
		}
	}
</script>
<style>
	page{
		background: #f0f0f0;
	}
</style>
<style lang="scss" scoped>
	.kuangjia{
		width: 710rpx;
		padding: 20rpx;
		.kapian{
			padding: 30rpx;
			border-radius: 20rpx;
			color: #ffffff;
			margin-bottom: 20rpx;
			.katou{
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 26rpx;
				color: #ffaa00;
				.kpmc{
					font-size: 40rpx;
					font-weight: bold;
					font-style:oblique;
				}
			}
			.neirong{
				margin: 30rpx 0 30rpx 50rpx;
				font-size: 26rpx;
				color: #808080;
				.vipzs{
					font-size: 80rpx;
					font-weight: bold;
					font-style:oblique;
					color: #ff007f;
				}
				.cishu{
					display: flex;
					align-items: flex-end;
					margin-left: 300rpx;
					
					.chis{
						font-size: 30rpx;
						font-weight: bold;
						color: #ffffff;
						margin-left: 20rpx;
					}
					.danw{
						color: #ffaa00;
						margin-left: 10rpx;
					}
				}
			}
			.youxq{
				font-size: 26rpx;
				text-align: right;
				color: #ffffff;
				margin-top: 50rpx;
			}
		}
		.p1{
			background-image: url(../../static/ka1.jpg);
			background-size:100%;
			background-repeat:no-repeat; 
		}
		.p2{
			background-image: url(../../static/hjk.jpg);
			background-size:100%;
			background-repeat:no-repeat; 
		}
		.tianjia{
			display: flex;
			align-items: center;
			padding: 20rpx;
			background: #ffffff;
			border-radius: 20rpx;
			.tianjia{
				width: 50rpx;
				height: 50rpx;
			}
		}
	}
</style>
